<?php
// Define TimeZone & Config file
Yii::app()->setTimeZone('Asia/Ho_Chi_Minh');
setlocale(LC_TIME, "vi_VN.UTF-8");
define ('IMAGES_DIR', dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR);
require(dirname(__FILE__).DIRECTORY_SEPARATOR.'config.php');

return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'NexttopEVENT Mang su kien hang dau Viet Nam',
	'defaultController'=>'Home/default/index',
	'theme'=>'nte',
	'sourceLanguage'=>'en',
    'language'      =>'vi',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	'modules'=>array(
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'1',
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		// Dashboard module
		'Home',
		// Event module
		'Events',
		// Users module
		'Users',
	),

	// application components
	'components'=>array(
		'user'=>array(
			'allowAutoLogin'=>true,
			'loginUrl'=>array('/Users/default/authenticate'),
		),
		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName'=>false,
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

				// Events Module
                    // default controller
                'su-kien/<slug:([a-zA-Z0-9\-]+)>'=>array('/Events/default/index', 'urlSuffix'=>'.html'),
				'su-kien-<category:([a-zA-Z0-9\-]+)>/<url:([a-zA-Z0-9\-]+)>'=>array('/Events/default/view', 'urlSuffix'=>'.html'),
                'cap-nhat/su-kien-<category:([a-zA-Z0-9\-]+)>/<url:([a-zA-Z0-9\-]+)>'=>array('/Events/default/update', 'urlSuffix'=>'.html'),
                'lam-moi/su-kien-<category:([a-zA-Z0-9\-]+)>/<url:([a-zA-Z0-9\-]+)>'=>array('/Events/default/refresh', 'urlSuffix'=>'.html'),
                'dat-ve/su-kien-<category:([a-zA-Z0-9\-]+)>/<url:([a-zA-Z0-9\-]+)>'=>array('/Events/default/order', 'urlSuffix'=>'.html'),
                'thong-tin-dat-ve-<id:([0-9\-]+)>'=>array('/Events/default/orderSuccess', 'urlSuffix'=>'.html'),
                'dang-su-kien'=>array('/Events/default/create', 'urlSuffix'=>'.html'),
                    // categories controller
				'danh-muc/<url:([a-zA-Z0-9\-]+)>'=>array('/Events/categories/view'),
				'dia-diem/<location:([a-zA-Z0-9\-]+)>'=>array('Events/categories/locationEvent', 'urlSuffix'=>'.html'),
                'su-kien-mien-phi'=>array('/Events/categories/freeEvent', 'urlSuffix'=>'.html'),
                'su-kien-co-phi'=>array('/Events/categories/paidEvent', 'urlSuffix'=>'.html'),
                'su-kien-uu-dai'=>array('/Events/categories/giftEvent', 'urlSuffix'=>'.html'),
                'su-kien-ngay-<day:([0-9\-]+)>-<month:([0-9\-]+)>-<year:([0-9\-]+)>'=>array('/Events/categories/dayEvent', 'urlSuffix'=>'.html'),
                'su-kien-hot'=>array('/Events/categories/hotEvent', 'urlSuffix'=>'.html'),
                    // request controller
                'su-kien-tuong-tu'=>array('/Events/request/suggestEvent', 'urlSuffix'=>'.html'),
                'xoa-lien-he'=>array('/Events/request/deleteContact', 'urlSuffix'=>'.html'),
                'xoa-ve-su-kien'=>array('/Events/request/deleteTicket', 'urlSuffix'=>'.html'),
                'su-kien-trong-ngay'=>array('/Events/request/eventInDay', 'urlSuffix'=>'.html'),
                'su-kien-trong-tuan'=>array('/Events/request/eventInWeek', 'urlSuffix'=>'.html'),
                'su-kien-trong-thang'=>array('/Events/request/eventInMonth', 'urlSuffix'=>'.html'),
                    // search controller
                'tim-kiem'=>array('/Events/search/index'),
				// Home Module
				'/'=>array('/Home/default/index'),
				'tin-tuc'=>array('/Home/news/index', 'urlSuffix'=>'.html'),
				'tin-tuc/<slug:([a-zA-Z0-9\-]+)>'=>array('/Home/news/view', 'urlSuffix'=>'.html'),
				'<slug:([a-zA-Z0-9\-]+)>'=>array('/Home/labels/view', 'urlSuffix'=>'.tag'),
                'noi-dung/<slug:([a-zA-Z0-9\-]+)>'=>array('/Home/default/viewArticles', 'urlSuffix'=>'.html'),
				// Users Module
                    // default controller
                'dang-nhap'=>array('/Users/default/login', 'urlSuffix'=>'.html'),
                'dang-ky'=>array('/Users/default/authenticate', 'urlSuffix'=>'.html'),
                'dang-xuat'=>array('/Users/default/logout', 'urlSuffix'=>'.html'),
                    // profile controller
                'su-kien-cua-toi-<id:([0-9\-]+)>'=>array('/Users/profiles/eventMe', 'urlSuffix'=>'.html'),
                'su-kien-dat-mua-<id:([0-9\-]+)>'=>array('/Users/profiles/eventOrder', 'urlSuffix'=>'.html'),
                'trang-ca-nhan-<id:([0-9\-]+)>'=>array('/Users/Members/profile', 'urlSuffix'=>'.html'),
                
			),
		),
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=nexttope_new',
			'emulatePrepare' => true,
			'username' => 'nexttope_dnd',
			'password' => 'Dnd@2014',
			'charset' => 'utf8',
		),
		'errorHandler'=>array(
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
			),
		),
	),
	'params'=>array(
		'adminEmail'=>'webmaster@example.com',
		'sales'=>'sale@nexttopevent.com',
		'marketing' => 'marketing@nexttopevent.com',
		'tech' =>'it@nexttopevent.com',
	),
);